
//Interface for building abstract assembly trees from pascal statements.


// on the beginning data for every procedure/function and main block must be allocated. 
// Allocation consist of blockName (for main body blockName=="main") and data size in this block
//AATstatement Allocate(Label blockName, int dataSize);

AATstatement Allocate(AATexpressionList blocks);
AATexpression MemoryAllocation(Label blockName, int dataSize);


AATexpression ConstantBoolExpression(int value);
AATexpression ConstantIntExpression(int value);
AATexpression OperatorExpression(AATexpression left, AATexpression right, AAToperator operator);
AATstatement AssignmentStatement(AATexpression lhs, AATexpression rhs);
AATstatement SequentialStatement(AATstatement first, AATstatement second);

AATexpression BooleanVariable(Label blockName, int offset);
AATexpression IntegerVariable(Label blockName,int offset);
AATstatement EmptyStatement(void);

// baseOffset -> like offset in boolean or integer variable. Points on the beginning of array
// index -> index in array
// leftArrayIndex -> index which points to the begining of array: array[leftArrayIndex..rightArrayIndex]
// elementSize -> size of one element in array.
// e.g. for array of integer numbers elementSize==4
// for array of record type elements, say:
// record x:integer; y:integer; end;
// elementSize==8
AATexpression ArrayVariable(Label blockName, int baseOffset, AATexpression leftArrayIndex, AATexpression index, int elementSize);

AATexpression RecordVariable(Label blockName, int baseOffset, int internalVariableOffset);

AATstatement IfStatement(AATexpression test, AATstatement ifbody, AATstatement elsebody);

AATstatement CallStatement(Label name, AATexpressionList actuals);
AATstatement ProcedureDefinition(AATstatement body, int argsSize ,Label start, Label end);

AATstatement CallPrintStatement(AATexpression exp);
AATstatement CallPrintLineStatement();

AATstatement WhileDoStatement(AATexpression test, AATstatement dowhilebody);



